using System;
using System.Collections.Generic;
using System.Text;
using Emlyn.Common.Data.DBUpdater;
using Emlyn.Common.Data.SqlServer.SqlManagers;

namespace Emlyn.Website.EmlynORegan.DBUpdateRules
{
    class DUR_0100_AddOrderToArticleArticle: IDBUpdaterRule
    {
        #region IDBUpdaterRule Members

        public int UpgradeFromVersion()
        {
            return 90;
        }

        public int UpgradeToVersion()
        {
            return 100;
        }

        public void PerformUpgrade()
        {
            string ltblAddOrdernumToArticleArticle =
                "ALTER TABLE dbo.tblEOArticle_Article ADD " +
                "  OrderNum numeric(18, 0) NOT NULL CONSTRAINT DF_tblEOArticle_Article_OrderNum DEFAULT 1 ";
            SqlManager.Execute(ltblAddOrdernumToArticleArticle);
        }

        #endregion
    }
}
